clc;
clear;

left = -1;
right = 1;
bottom = -1;
top = 1;
Nx = 10;
Ny = 10;
hx = (right-left)/Nx;
hy = (top-bottom)/Ny;
h_partition = [hx, hy];
basis_type = 1;

[uh1, uh2] = Elasticity_solver_triangle(left,right,bottom,top,h_partition,basis_type);

x = linspace(left, right, Nx+1);
y = linspace(bottom, top, Ny+1);
[X, Y] = meshgrid(x, y);
z1 = reshape(uh1, [Nx+1,Ny+1]);
z2 = reshape(uh2, [Nx+1,Ny+1]);
figure;
subplot(2, 2, 1);
surf(X, Y, z1);
xlabel('X');
ylabel('Y');
zlabel('uh1');
title('第一个数值解');
subplot(2, 2, 2);
surf(X, Y, u1_exact_solution(X,Y));
xlabel('X');
ylabel('Y');
zlabel('exact1');
title('第一个精确解');
subplot(2, 2, 3);
surf(X, Y, z2);
xlabel('X');
ylabel('Y');
zlabel('uh2');
title('第二个数值解');
% subplot(2, 2, 4);
% surf(X, Y, u2_exact_solution(X,Y));
% xlabel('X');
% ylabel('Y');
% zlabel('exact2');
% title('第二个精确解');

check_Elasticity_FE_solution_error_triangle_linear
% check_Elasticity_FE_solution_error_triangle_quadratic